package com.west.xu.nacos.controller;

import com.west.xu.nacos.bean.City;
import com.west.xu.nacos.bean.Extend;
import com.west.xu.nacos.bean.File;
import com.west.xu.nacos.bean.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class NacosController {

    @Autowired
    private City city;
    @Autowired
    private Log log;
    @Autowired
    private File file;
    @Autowired
    private Extend extend;

    @RequestMapping("/city")
    public String get() {
        return city.getName() + "===>" + city.getCode();
    }

    @RequestMapping("/query")
    public String query() {
        return "CityName:"
                + city.getName()
                + "===>"
                + "CityCode:"
                + city.getCode()
                + "===>"
                + "LogLevel:"
                + log.getLogLevel()
                + "===>"
                + "FilePath:"
                + file.getFilePath()
                + "===>"
                + "Extend:"
                + extend.getMessage()
                ;
    }
}
